from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from talist.talistapp.models import AddSectionForm

@login_required
def list_sections(request):
    return render_to_response('sections.html')


@login_required
def add_section(request):
    if request.method == 'POST':
        form = AddSectionForm(request.POST)
        if form.is_valid():
            # Do form processing here...
            return HttpResponseRedirect('/')
    else:
        form = AddSectionForm()
    return render_to_response('add_section.html', {'form': form})



